<template>
    <div>
        <a-card v-if="data.photo" :bordered="false" title="照片">
            <div style="width: 160px; height: 200px">
                <img :src="'/' + data.photo" style="width: auto; height: auto; max-width: 100%; max-height: 100%">
            </div>
        </a-card>
        <a-card :bordered="false" title="基础信息">
            <a-descriptions :column="4">
                <a-descriptions-item v-for="(item, index) in items" :key="index" :label="item.label">
                    {{data[item.key] || '-'}}
                </a-descriptions-item>
            </a-descriptions>
        </a-card>

        <a-card v-if="data.ext && data.ext.study" style="margin-top: 24px" :bordered="false" title="学习简历">
            <a-descriptions v-for="(item, index) in data.ext.study" :key="index" :column="5"
                            :title="study[index]">
                <a-descriptions-item label="起止时间">{{item.time || '-'}}</a-descriptions-item>
                <a-descriptions-item label="毕业学校">{{item.college || '-'}}</a-descriptions-item>
                <a-descriptions-item label="专业">{{item.major || '-'}}</a-descriptions-item>
                <a-descriptions-item label="研究方向">{{item.research || '-'}}</a-descriptions-item>
                <a-descriptions-item label="学制">{{item.system || '-'}}</a-descriptions-item>
            </a-descriptions>
        </a-card>

        <a-card v-if="data.ext" style="margin-top: 24px" :bordered="false" title="补充信息">
            <a-descriptions v-for="(item, index) in extItems" :key="index" :column="1" :title="item.label">
                <a-descriptions-item v-for="(desc, idx) in data.ext[item.key]" :key="idx">
                    {{desc}}</a-descriptions-item>
            </a-descriptions>
        </a-card>
    </div>
</template>

<script>
    import Adapter from '@/utils/adapter'
    export default {
        name: "ResumeContent",
        props: {
            data: {
                type: Object,
                required: true
            }
        },
        data() {
            return {
                study: ['本科', '硕士研究生', '博士研究生'],
                items: Adapter.ResumeItems.BaseItems,
                extItems: Adapter.ResumeItems.ExtItems
            }
        },
    }
</script>

<style scoped>

</style>
